// ExampleMovementSystem.java - 示例移动系统
package com.goldsprite.gameframeworks.ecs.system;

import com.goldsprite.gameframeworks.ecs.component.*;
import com.goldsprite.gameframeworks.ecs.entity.*;
import java.util.*;
import com.goldsprite.gameframeworks.utils.*;

@GameSystemInfo(
	type = GameSystemInfo.SystemType.UPDATE,
	interestComponents = { SpriteComponent.class, AnimatorComponent.class }
)
public class AnimatorSystem extends BaseSystem {

	@Override
	public void update(float delta) {
		List<GObject> ents = getInterestEntities();
		for (GObject entity : ents) {
			AnimatorComponent animator =  entity.getComponent(AnimatorComponent.class);
			if (animator == null){
				continue;
			}
			animator.step(delta);
		}
	}
}
